<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUserAuthTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_auth', function (Blueprint $table) {
            $table->unsignedBigInteger('user_id')->primary()->comment('用户id');
            $table->string('idcard_name', 255)->comment('真实姓名');
            $table->string('idcard_num', 120)->default('')->comment('身份证号-加密');
            $table->string('card_name', 60)->default('')->comment('证件名称');
            $table->string('idcard_a_img', 450)->default('')->comment('身份证正面');
            $table->string('idcard_b_img', 450)->default('')->comment('身份证反面');
            $table->text('card_paths')->nullable()->comment('其他认证图片');
            $table->timestamp('idcard_end_time')->nullable()->comment('身份证过期时间');
            $table->timestamp('add_time')->nullable()->comment('实名时间');
            $table->timestamp('pass_time')->nullable()->comment('认证通过时间');
            $table->char('idcard_address', 200)->nullable()->comment('地址');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user_auth');
    }
}
